home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4689 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: news.rmii.com!usenet
  2. From: jcoffin@rmii.com (Jerry Coffin)
  3. Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.lang.c++
  4. Subject: Re: HELP !!! Memory - Allocation
  5. Date: Wed, 31 Jan 1996 19:33:45 GMT
  6. Organization: TAEUS
  7. Message-ID: <4eoc68$5en@natasha.rmii.com>
  8. References: <1996Jan28.015441.7082@mcs.drexel.edu> <4eg4h2$4he@news1.usa.pipeline.com>
  9. NNTP-Posting-Host: slip22166.rmii.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. grantp@usa.pipeline.com(Pete) wrote:
  13.  
  14. [ I've trimmed the newsgroups since this seems to have little to do with
  15. compatibility of applications... ] 
  16.  
  17. >On Jan 28, 1996 01:54:41 in article <Re: HELP !!! Memory - Allocation>,
  18. >'urcrawfo@mcs.drexel.edu (Programmer)' wrote: 
  19. >>It is highly recommended using the "new" operator when using C++. 
  20. >>It is both practical and effifienct. 
  21. >> 
  22. >I agree with the recommendation; however, just to set the 
  23. >record straight :-) 
  24. >On some systems, notably g++ 2.6.3, new performs a few  
  25. >instructions of its own, then calls malloc.  This leads me to 
  26. >conclude that new is less efficient than a direct call to  
  27. >malloc -- although the margin is probably very narrow. 
  28.  
  29. This depends heavily (perhaps completely) on the situation.  This may be
  30. how g++ 2.6.3 implements global operator new, but the program can
  31. redefine this as needed on either a global basis (rarely reccomended) or
  32. for particular classes.  In the latter case new may be, and often is,
  33. considerably more efficient than malloc.
  34.  
  35.